package cn.wolfcode.domain;

import com.alibaba.fastjson.JSON;
import lombok.*;

import java.util.HashMap;


@NoArgsConstructor
@Setter
@Getter
@ToString
@AllArgsConstructor
public class Department {
    private Long id;

    private String name;
    private String sn;

    public String getJson() {
        //数据更安全


        HashMap<String, Object> map = new HashMap<>();
        map.put("id",id);
        map.put("name",name);
        map.put("sn",sn);
        return JSON.toJSONString(map);//直接传this会死循环

    }





}